--[[/**
-- * 
 * 吸血效果,并且给buff施法者 也回复 n%%
 * [0] n 万分比
-- *
-- */]]

---@class BuffEffect484101 : BaseBuffEffect
BuffEffect484101 = ClientFight.CreateClass("BuffEffect484101", ClientFight.BaseBuffEffect)
local t = BuffEffect484101

---@param fight Fight
---@param buff FighterBuff
function t:action(fight, buff, ...)
    local parameters = {...};
    local source = buff.source;
    if (table.getn( parameters) < 6)then
    return IBuffEffect.FAIL;
    end
    local suckBlood =  parameters[6];
    if (suckBlood < 1)then
    return IBuffEffect.FAIL;
    end
    if (source:isDie())then
    return IBuffEffect.FAIL;
    end
    local buffEffectValue = buff.buffBean.f_BuffEffectValue;
    local addHp = (suckBlood * Utils.toRatio(buffEffectValue[1]));
    DamageManager.setFighterHp(fight, source, buff.target, nil, DamageResultTypeEnum.HEAL,addHp,
    source.hp + addHp, true, false, true);
    SkillRoleMgr.savePathFile("[" .. fight.frame .. "][EFFECT]Fighter " .. buff.target.fighterId .. " Buff:"
    .. buff.modelId .. " 吸血效果 : ".. suckBlood ..",并且额外给buff施法者: " .. source.fighterId .." 吸血:"..addHp);
    return ClientFight.BaseBuffEffect.action(self, fight, buff, ...);
end

t.New()